#include <stdio.h>
#include "test-bench.h"

int test_matches_val(double value, double target, double error) {
  double max = target+error;
  double min = target-error;
  return (value <= max && value >= min) ? 1 : 0;
}

void wg_test(void (setup)(void), char *title, int(test)(void)) {
  setup();
  printf("Testing %s:\n", title);
  if(test())
    {
      printf("Failed!\n");
    }
  else
    {
      printf("Passed!\n");
    }
}
